<?php
$form = $this->changePasswordForm;
$formmsg = $form->getMessages();
if ($status === true)  {
	echo $this->helper()->makeFlashMsg(array('text'=>"Enregistrement bien effectué", 'type'=>'success'));	
} elseif ($status === false) {
	echo $this->helper()->makeFlashMsg(array('text'=>"Enregistrement échouée, veuillez bien remplir le formulaire", 'type'=>'error'));
}
$form->get('submit')->setValue('Enregistrer')->setAttribute('class', 'btn');
$emailElement = $form->get('identity');
$emailElement->setValue($this->zfcUserIdentity()->getEmail());
?>

<form
	action="<?php echo $this->url('user', array('action'=>'change-password'));?>"
	method="post">
	<fieldset>
		<legend>
			Changement du mot de passe de <?php echo $this->zfcUserDisplayName() ?>
		</legend>
		<div class="row-fluid">
			<fieldset class="span6">
				<div
					class="control-group <?php if(!empty($formmsg['identity'])) echo 'error'?>">
					<?php 
					echo $this->formElement($form->get('identity'));
					?>
				</div>
				<div
					class="control-group <?php if(!empty($formmsg['credential'])) echo 'error'?>">
					<?php 
					echo $this->formLabel($form->get('credential'));
					echo $this->formElement($form->get('credential'));
					?>
				</div>
				<div
					class="control-group <?php if(!empty($formmsg['newCredential'])) echo 'error'?>">
					<?php 
					echo $this->formLabel($form->get('newCredential'));
					echo $this->formElement($form->get('newCredential'));
					?>
				</div>
				<div
					class="control-group <?php if(!empty($formmsg['newCredentialVerify'])) echo 'error'?>">
					<?php 
					echo $this->formLabel($form->get('newCredentialVerify'));
					echo $this->formElement($form->get('newCredentialVerify'));
					?>
				</div>
			</fieldset>
		</div>
	</fieldset>
	<fieldset class="form-actions">
		<?php echo $this->formSubmit($form->get('submit')) ?>
	</fieldset>
</form>